package sjtu.rfid.rri.services.ale;

import java.util.List;

import javax.jws.WebParam;
import javax.jws.WebService;

import sjtu.rfid.rri.services.ale.exception.DuplicateNameException;
import sjtu.rfid.rri.services.ale.exception.DuplicateSubscriptionException;
import sjtu.rfid.rri.services.ale.exception.ECSpecValidationException;
import sjtu.rfid.rri.services.ale.exception.ImplementationException;
import sjtu.rfid.rri.services.ale.exception.InvalidURIException;
import sjtu.rfid.rri.services.ale.exception.NoSuchNameException;
import sjtu.rfid.rri.services.ale.exception.NoSuchSubscriberException;
import sjtu.rfid.rri.services.ale.reading.ECReports;
import sjtu.rfid.rri.services.ale.reading.ECSpec;

@WebService
public interface ALE {
	void define(@WebParam(name = "specName") String specName,
			@WebParam(name = "spec") ECSpec spec) throws SecurityException,
			DuplicateNameException, ECSpecValidationException,
			ImplementationException;

	void undefine(@WebParam(name = "specName") String specName)
			throws SecurityException, NoSuchNameException,
			ImplementationException;

	ECSpec getECSpec(@WebParam(name = "specName") String specName)
			throws SecurityException, NoSuchNameException,
			ImplementationException;

	List<String> getECSpecNames() throws SecurityException,
			ImplementationException;

	void subscribe(@WebParam(name = "specName") String specName,
			@WebParam(name = "notificationURI") String notificationURI)
			throws InvalidURIException, DuplicateSubscriptionException,
			SecurityException, NoSuchNameException, ImplementationException;

	void unsubscribe(@WebParam(name = "specName") String specName,
			@WebParam(name = "notificationURI") String notificationURI)
			throws InvalidURIException, NoSuchNameException, SecurityException,
			NoSuchSubscriberException, ImplementationException;

	ECReports poll(@WebParam(name = "specName") String specName)
			throws SecurityException, NoSuchNameException,
			ImplementationException;

	ECReports immediate(@WebParam(name = "spec") ECSpec spec)
			throws SecurityException, ECSpecValidationException,
			ImplementationException;

	List<String> getSubscribers(@WebParam(name = "specName") String specName)
			throws SecurityException, NoSuchNameException,
			ImplementationException;

	String getStandardVersion() throws ImplementationException;

	String getVendorVersion() throws ImplementationException;
}
